<?php $this->_extends('_layouts/default_layout'); ?>
<?php echo $this->_block('title')?>
<?php echo '会员中心推荐赚钱',$config['sitename'] ?>
<?php echo $this->_endblock()?>
<?php echo $this->_block('meta')?>
<link rel="stylesheet"
	type="text/css" href="<?php echo $_BASE_DIR; ?>css/global.css" />
<link rel="stylesheet"
	href="<?php echo $_BASE_DIR; ?>images/account_con.css" type="text/css">
	
	<script type="text/javascript" src="<?php echo $_BASE_DIR?>javascripts/jquery.min.js"></script>
<?php echo $this->_endblock()?>
<?php $this->_block('center'); ?>
<div>
	<img src="<?php echo $_BASE_DIR; ?>images/account_con_03.jpg">
</div>
<div id="maincon_c">
<?php $this->_element('userleft') ?>
	<div id="maincon_c_r">
			
				<div id="pwd_protect_title">
				<h3>密码修改</h3>
				</div>
				<hr>
				<p id="p_step1">您的绑定号码:<font color="red"><span id="usermoney"><?php echo $userdata->userphone;?></span></font>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="red"><span id="send_err"></span></font></p>
				
			
			<div id="msg"></div>
			<div id="step1">
				
				<div class="clear"></div>
				
				
				<form onsubmit="changepwd();return false;">
					<table class="getbind_table" border="0" cellpadding="0" cellspacing="0">
						
						<tbody>
						<tr>
							<td style="text-align: right;"><strong>原密码：</strong></td>
							<td><input  name="oldpass" id="oldpass"  maxlength="20" class="getback" type="text"></td>
							<td></td>
						</tr>
						
						<tr>
							<td style="text-align: right;"><strong>新密码：</strong></td>
							<td><input onkeypress="return event.keyCode>=48&&event.keyCode<=57||event.keyCode==46"
onpaste="return !clipboardData.getData('text').match(/\D/)"
ondragenter="return false"
style="ime-mode:Disabled" name="newpass" id="newpass" maxlength="10" class="getback" type="text"></td>
							<td></td>
						</tr>
						<tr>
							<td style="text-align: right;"><strong>确认：</strong></td>
							<td><input onkeypress="return event.keyCode>=48&&event.keyCode<=57||event.keyCode==46"
onpaste="return !clipboardData.getData('text').match(/\D/)"
ondragenter="return false"
style="ime-mode:Disabled" name="configpass" id="configpass" maxlength="10" class="getback" type="text"></td>
							<td></td>
						</tr>
						
					</tbody></table>
					<div class="clear"></div>
					<br>
					<div id="account_vouch_btnzone">
						<input  id="next" value="确认修改" type="submit">
					</div>
					
				</form>
				
			</div>
			
			
				<br>
				<hr><br>
				<strong>修改密码介绍：</strong><br>
				<p>修改密码请输入正确的原始密码！</p>
				
			</div>
			<div class="clear"></div>
</div>

<div style="margin-bottom: 10px;">
	<img src="<?php echo $_BASE_DIR; ?>images/account_con_15.jpg">
</div>
<script>
function changepwd()
{
	//var smscode =  document.getElementById('smscode');
	var oldpass = document.getElementById('oldpass');
	var newpass = document.getElementById('newpass');
	var configpass = document.getElementById('configpass');
	var send_err = document.getElementById('send_err');
	var reg = /^\d{1,10}$/;

	if(oldpass.value == '')
	{
		send_err.innerHTML= '您必须输入当前密码';
		oldpass.focus();
		}else if (newpass.value == '')
		{
		send_err.innerHTML='您必须输入新密码';
		newpass.focus();
		}else if (reg.test(newpass.value) == false)
		{
			send_err.innerHTML = '密码必须为1-10位数字';
			newpass.focus();
			}
		else if(configpass.value == '')
		{
			send_err.innerHTML = '您必须输入确认密码';
			configpass.focus();
			}else if (configpass.value != newpass.value)
			{
				send_err.innerHTML='两次密码不一致';
				newpass.focus();
				}else if(confirm('请确认修改密码!'))				
				{
				$.post(
						'<?php echo url("users/changepwd")?>',
						'oldpass='+oldpass.value+'&'+'newpass='+newpass.value+'&configpass='+newpass.value,
						function(data){
							if(data.status)
							{
								alert('修改成功,请使用新密码登陆!');
								}else
								{
								alert(data.message);
									}
							},
						'json'
						);
				}
	}
function getmobile_rnd()
{
	
	$.post('<?php echo url('default::interface/smscode')?>','',function(str){
		alert(str);},'json');
}
</script>
<?php $this->_endblock(); ?>
